hvm svm: Fix for BSOD when "migrating" from Intel to AMD.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 14 Jun 2007 14:54:57 +0000 (15:54 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 14 Jun 2007 14:54:57 +0000 (15:54 +0100)
The Intel processor driver for Windows (XP and later at least) reads
an MSR that AMD doesn't have. This causes GP-fault in kernel mode,
which causes blue-screen-of-death on Windows. This prevents a
disk-image that was installed on Intel from starting on an AMD
processor.

This patch "fixes" the problem by allowing reads from the msr,
returning all zero's (which is a valid, if not particulary
meaningful, value for this register).

Signed-off-by: Mats Petersson <mats.petersson@amd.com>
xen/arch/x86/hvm/svm/svm.c
xen/include/asm-x86/msr.h

index 64d0f0023f86e3c898b0c45ced1f1cc501ca2d99..c26ebc4d1fa1b9c9b0ea70af32be20691d423f5f 100644 (file)
@@ -2089,6 +2089,15 @@ static inline void svm_do_msr_access(
             msr_content = 1ULL << 61; /* MC4_MISC.Locked */
             break;
 
+        case MSR_IA32_EBC_FREQUENCY_ID:
+            /*
+             * This Intel-only register may be accessed if this HVM guest
+             * has been migrated from an Intel host. The value zero is not
+             * particularly meaningful, but at least avoids the guest crashing!
+             */
+            msr_content = 0;
+            break;
+
         default:
             if ( rdmsr_hypervisor_regs(ecx, &eax, &edx) ||
                  rdmsr_safe(ecx, eax, edx) == 0 )
index 80e9da6576cb99e3c9971a7a46fca2277f59461f..862e02c5d3c549d2a764175b293ce50196d090d3 100644 (file)
@@ -96,6 +96,7 @@ static inline void wrmsrl(unsigned int msr, __u64 val)
 #define MSR_IA32_TIME_STAMP_COUNTER     0x10
 #define MSR_IA32_PLATFORM_ID           0x17
 #define MSR_IA32_EBL_CR_POWERON                0x2a
+#define MSR_IA32_EBC_FREQUENCY_ID      0x2c
 
 #define MSR_IA32_APICBASE              0x1b
 #define MSR_IA32_APICBASE_BSP          (1<<8)